<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                template="/mobile/templates/mobileTemplate.xhtml"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:p="http://primefaces.org/ui"
                xmlns:pm="http://primefaces.org/mobile" >

    <ui:define name="content">
        <h2>#{bundle['offer.header']}</h2>
       <h:form prependId="false" >
           <pm:field>

                <h:selectOneMenu id="selectOneMenu" value="#{tarrifsParks.selectedCarType}"> 
                    <p:ajax event="change" update="offer"></p:ajax>
                    <f:selectItem itemLabel="Wybierz" itemValue="" />

                    <f:selectItems value="#{tarrifsParks.carTypes}"  />
                </h:selectOneMenu>
            </pm:field>
           <p:dataTable id="offer" var="tarrif" value="#{tarrifsParks.tarrifsFilter}" > 
                        <f:attribute name="columnToggle" value="true" />
                        <f:attribute name="btnText" rendered="false" value="Wyświetlane kolumny"  />                                                  
                        <p:column headerText="Nazwa">          
                            <f:attribute name="priority" value="1" />
                            <h:outputText value="#{tarrif.name}" />  
                        </p:column>  

                        <p:column headerText="Stawka" >                              
                            <h:outputText value="#{tarrif.rank}" />  
                        </p:column>  

                        <p:column headerText="Czas trwania">  
                            <f:attribute name="priority" value="1" />
                            <h:outputText value="#{tarrifsParks.getLabelForDurrationTime(tarrif)}" />  
                        </p:column>  
                 
                    </p:dataTable> 
       </h:form>

    </ui:define>
</ui:composition>